import request from '@/utils/request'

// 查询隐患列表
export function listYh(query) {
  return request({
    url: '/anquan/yh/list',
    method: 'get',
    params: query
  })
}

// 查询隐患详细
export function getYh(yhId) {
  return request({
    url: '/anquan/yh/' + yhId,
    method: 'get'
  })
}

// 新增隐患
export function addYh(data) {
  return request({
    url: '/anquan/yh',
    method: 'post',
    data: data
  })
}

// 修改隐患
export function updateYh(data) {
  return request({
    url: '/anquan/yh',
    method: 'put',
    data: data
  })
}

// 删除隐患
export function delYh(yhId) {
  return request({
    url: '/anquan/yh/' + yhId,
    method: 'delete'
  })
}

// 导出隐患
export function exportYh(query) {
  return request({
    url: '/anquan/yh/export',
    method: 'get',
    params: query
  })
}